<template>
    <div class="contentDiv">
        <Form :label-width="180" :disabled="true">
            <Row>
                <i-col span="24" class="title">
                    <Form-item :label-width="10">
                        打印信息
                    </Form-item>
                </i-col>
            </Row>
            <Row>
                <i-col span="12">
                    <Form-item label="户主姓名:">
                        <Input v-model="ss22002Dto.dczb0002"/>
                    </Form-item>
                </i-col>
                <i-col span="12">
                    <Form-item label="保障给予时间:">
                        <Input v-model="ss22001Dto.dcza0002Date"/>
                    </Form-item>
                </i-col>
            </Row>
            <Row>
                <i-col span="12">
                    <Form-item label="签发日期:">
                        <Input v-model="ss22001Dto.dcza0003Date"/>
                    </Form-item>
                </i-col>
                <i-col span="12">
                    <Form-item label="批准机关:">
                        <Input v-model="ss22001Dto.dcza0012Name"/>
                    </Form-item>
                </i-col>
            </Row>
            <Row>
                <i-col span="24" class="title">
                    <Form-item :label-width="10">
                        打印记录
                    </Form-item>
                </i-col>
            </Row>
            <Row>
                <i-col span="12">
                    <Form-item label="打印状态:">
                        <Input v-model="ss22001Dto.dcza0101Name"/>
                    </Form-item>
                </i-col>
                <i-col span="12">
                    <Form-item label="打印时间:">
                        <Input v-model="ss22001Dto.dcza0102Date"/>
                    </Form-item>
                </i-col>
            </Row>
            <Row>
                <i-col span="12">
                    <Form-item label="打印人:">
                        <Input v-model="ss22001Dto.dcza0103"/>
                    </Form-item>
                </i-col>
            </Row>
        </Form>
        <Row>
            <i-col span="24" class="title">
                <Button type="primary" @click="print" :disabled="!canPrint">打印</Button>
            </i-col>
        </Row>
    </div>
</template>

<script>
    import {postAction} from '@/api/request'
    import ICol from "view-design/src/components/grid/col";
    import {CommonMixin} from '@/views/common/js/CommonMixin'
    import {LodopMixin} from '../lodop'

    export default {
        mixins: [CommonMixin, LodopMixin],
        components: {ICol},
        props: ['ss22001Dto', 'ss22002Dto', 'lodopHomePagePrint', 'dcza0011'],
        data() {
            return {
                modal1: false,
                visible: false,
                disableSubmit: false,
                title: "",
                model: {},
                canPrint: false,
            }
        },
        methods: {
            print() {
                var param = new Object();
                param.lodopHomePagePrint = this.lodopHomePagePrint;
                param.dbzp0001 = this.dcza0011;
                param.dbzp0002 = "PTN_1";
                this.commonPrint(param, 5, this.ss22001Dto.id, null);
            }
        },
        mounted() {
            if (this.ss22001Dto && this.ss22002Dto) {
                if (this.ss22001Dto.dcza0002) {
                    this.$set(this.ss22001Dto, "dcza0002Date", this.DateFormat(this.ss22001Dto.dcza0002, 'YYYY-MM'));
                }
                if (this.ss22001Dto.dcza0003) {
                    this.$set(this.ss22001Dto, "dcza0003Date", this.DateFormat(this.ss22001Dto.dcza0003, 'YYYY-MM-DD'));
                }
                if (this.ss22001Dto.dcza0012) {
                    this.$set(this.ss22001Dto, "dcza0012Name", this.ss22001Dto.dcza0012 + "民政局");
                }
                if (this.ss22001Dto.dcza0101 == '0') {
                    this.$set(this.ss22001Dto, "dcza0101Name", "未打印");
                    this.ss22001Dto.dcza0101Name = "未打印";
                    this.canPrint = true;
                } else {
                    this.$set(this.ss22001Dto, "dcza0101Name", "已打印");
                }
                if (this.ss22001Dto.dcza0102) {
                    this.$set(this.ss22001Dto, "dcza0102Date", this.DateFormat(this.ss22001Dto.dcza0102, 'YYYY-MM-DD'));
                }
            }
        }
    }
</script>

<style scoped>
    /deep/ .title {
        height: 50px;
        text-align: center;
        line-height: 50px;
    }
</style>